home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 11063 < prev    next >
Encoding:
Text File  |  1996-08-05  |  2.2 KB  |  90 lines

  1. Path: news.internetMCI.com!news-admin
  2. From: "Michael P. Lascuola" <mlascuola@mcimail.com>
  3. Newsgroups: comp.lang.c++
  4. Subject: Help creating 32-bit .DLL
  5. Date: Tue, 12 Mar 1996 08:14:59 -0700
  6. Organization: InternetMCI
  7. Message-ID: <314594F3.DCC@mcimail.com>
  8. NNTP-Posting-Host: 166.37.9.79
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 2.0 (Win95; I)
  13.  
  14. Has anyone created a .DLL for Visual FoxPro 3.0?  I've been having a 
  15. devil of a time.  I have created the .CPP program and created the .DLL 
  16. using Borland  4.52, but Fox says "Cannot find entry point <function> in 
  17. the DLL."
  18.  
  19. Does anyone have any suggestions?  THANKS!
  20.  
  21. Here is the .CPP:
  22.  
  23. //--------------------------------------------------------------------- 
  24. //      Name: TEST.CPP
  25. //      Description: Test of .DLL called by VFP
  26. //---------------------------------------------------------------------#include <string.h>
  27. #include <ctype.h>
  28. #include <windows.h>
  29. #include <stdio.h>      // for sprintf
  30. #include <time.h>       // for time_t
  31.  
  32. HANDLE hInst;
  33. int WinDoc;
  34.  
  35.  
  36.  
  37. /*********************************************************************** 
  38.      LibMain() - Entry point to DLL. Registers windows classes.
  39. ************************************************************************/
  40. BOOL WINAPI DLLEntryPoint( HANDLE hDll, DWORD dwReason, LPVOID
  41. lpReserved )
  42. {
  43.  
  44.         hInst = hDll;
  45. //Placed here to see if entry point ever reached
  46. FILE *out=fopen("DLL.log","w");
  47. char tbuf[28];
  48. time_t t = time(NULL);
  49. strcpy(tbuf,ctime(&t));
  50. fprintf(out,"      Started Log %s",tbuf);
  51. fclose(out);
  52.  
  53.         return( TRUE );
  54. }
  55.  
  56.  
  57.  
  58.  
  59. //* WEP
  60.  
  61. #if defined(__BORLANDC__) || defined(_MSC_VER)
  62. extern "C" int FAR PASCAL WEP
  63. #else
  64. extern "Pascal" int WEP
  65. #endif
  66. ( int )
  67. {
  68.                 return 1;
  69. }
  70.  
  71.  
  72.  
  73.  
  74.  
  75. //---------------------------------------------------------------------//
  76. // Function Name: UseXLT
  77. //
  78. // Description: Test function
  79. //
  80. //---------------------------------------------------------------------
  81.         char* FAR PASCAL _export UseXLT(char * str);
  82.  
  83.         char* FAR PASCAL _export UseXLT(char * str)
  84.         {
  85.         char *tempbuf;
  86.         tempbuf = new char[256];
  87.         sprintf(tempbuf, "%sNewValue", str);
  88.         return (char *)tempbuf;
  89.         }
  90.